<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>个人中心 -- 修改头像</title>
    <script src="js/vue.min.js"></script>
    <script src="js/axios.min.js"></script>
    <link href="https://www.hn-vs.cn/template/image/favicon.ico" rel="icon" type="image/x-icon">
    <link href="https://www.hn-vs.cn/template/image/favicon.ico" rel="shortcut icon" type="image/x-icon">
    <link href="https://www.hn-vs.cn/template/image/favicon.ico" rel="bookmark" type="image/x-icon">
    <link href="res/base.css" rel="stylesheet" type="text/css">
    <link href="res/head.css" rel="stylesheet" type="text/css">
</head>
<body id="centerBody">
<input type="hidden" id="_SELF_ID" value="18314486">
<input type="hidden" id="_DOMAIN" value="hn-vs.cn">
<link rel="stylesheet" href="res/chartbar.css">
<link rel="stylesheet" type="text/css" href="res/tree.css">
<link rel="stylesheet" type="text/css" href="res/icon.css">
<input type="hidden" value="/photo/system/smallHead_NotActived.jpg" id="myLogo">
<div class="bodydiv">
    <link href="res/bodyleft.css" rel="stylesheet" type="text/css">
    <link href="res/help.css" rel="stylesheet" type="text/css">
    <link href="res/Avatar.css" rel="stylesheet" type="text/css">
    <div id="bodyright">
        <link href="res/set.css" rel="stylesheet" type="text/css">
        <div id="Set">
            <div id="setimage"><img src="res/setup.png"></div>
            <div id="little">
                <div id="little2">
                    <h2>头像</h2>
                </div>
                <div id="back"><a href="javascript:history.go(-1);">&lt;&lt; 返回上一页</a></div>
            </div>
            <div id="Navigation">

                <div class="Navigation3">头像上传</div>
                <a href="myinfo.htm">
                <div class="Navigation2">修改个人资料</div>
                </a>
            </div>
        </div>
        <div id="card" class="ajax_upload_dialog">
            <div id="cardleft">
                <!--<div id="cardlittle">
                    <div class="cardlittle_left"></div>
                   <div class="cardlittle_right">上传头像</div>
                </div>-->
                <div id="Prompt">建议上传2Mb以下文件，宽高不超过900像素</div>
                <div style="float:left; clear:both; width:100%;">
<!--                    <form enctype="multipart/form-data" id="coverPic" action="https://www.hn-vs.cn/~set!uploadimage"-->
<!--                          method="post" target="ifm1" style="padding:0px; margin:0px; float:left;">-->
<!--                        <input type="hidden" name="APC_UPLOAD_PROGRESS" id="progress_key">-->
<!--                        <input type="text" name="Upload" id="Upload" readonly="true" style="z-index:1;">-->
<!--                        <input type="button" id="Button1" value="浏览">-->
<!--                        <input type="file" class="picUp ie8" size="1" id="uploadFile" name="upload[]">-->
<!--                        <input type="submit" id="Button2" value="上传">-->
<!--                    </form>-->
                    <div class="uping" id="status" style="display: none"></div>
                </div>
                <div id="photo">
                    <iframe id="ifm1" name="ifm1" frameborder="0" scrolling="No"
                            style="visibility:hidden;width:0px;height:0px;" src="res/saved_resource.html"></iframe>
                    <div class="imgback" id="imgback"><img id="backimg" name="backimg" style="display:none;"></div>
                    <div class="imgcut imgcutT"></div>
                    <div class="imgcut imgcutL"></div>
                    <div class="imgcutC" id="cropBorder"></div>
                    <div class="imgcut imgcutR"></div>
                    <div class="imgcut imgcutB"></div>
                    <div class="imgcover"></div>
                </div>
                <div id="Button4">缩&nbsp;&nbsp;小</div>
                <div id="sliderBar">
                    <div class="imgsizerq" id="imgsizerq"></div>
                    <div class="imgsizer" id="imgsizer"></div>
                    <div class="imgsizerh" id="imgsizerh"></div>
                    <div class="slidercover"></div>
                </div>
                <div id="Button5">放&nbsp;&nbsp;大</div>
            </div>
            <div id="cardright">
                <ul>
                    <li class="gao">&nbsp;&nbsp;<strong>当前头像</strong></li>
                    <li>
                        <div class="liimage">
                            <div class="preCover"><img id="bigHead" style="height: 100px;width: 100px;" name="bigHead" src="res/largeHead_NotActived.jpg">
                            </div>
                        </div>
                    </li>
                    <li class="gao">&nbsp;&nbsp;<strong>新头像</strong></li>
                    <li>
                        <div class="liimage">
                            <iframe id="ifmCrop" name="ifmCrop" frameborder="0" scrolling="No"
                                    style="visibility:hidden;width:0px;height:0px;"
                                    src=""></iframe>
                            <div class="preCover">
                                <img onclick="headfile.click()" style="cursor: pointer" title="点击上传"
                                     id="preImage" name="preImage" src="res/largeHead_NotActived.jpg">
                                <input onchange="upload()" type="file" id="headfile"
                                       accept="image/*" style="display: none">
                                <script>
                                    var userHead;
                                    function upload(){
                                        let fd = new FormData();
                                        fd.append("file",headfile.files[0]);
                                        axios.post("upload",fd).then(res=>{
                                            preImage.src = res.data.data;
                                            userHead = res.data.data;
                                            preImage.style.width="100%";
                                            preImage.style.height="100%";
                                        })
                                    }
                                </script>
                            </div>
                        </div>
                    </li>
                    <li class="gao">&nbsp;&nbsp;发布前请先预览</li>
                    <li>
                        <form name="" action="https://www.hn-vs.cn/~set!cropHeadImage" target="ifmCrop" method="POST">
                            <input type="hidden" name="cropParam" id="cropParam">
                            <input type="button" class="Button3" value="预览">
                            <input onclick="a()" type="button" class="Button3" value="完成">
                            <script>
                                function a() {
                                    let params = new URLSearchParams();
                                    params.append("head", userHead);
                                    axios.post("sp-user/cloudvideo/user/saveHead", params).then(res => {
                                        if (res.data.code == 1) {
                                            bigHead.src = userHead;
                                            preImage.src = 'res/largeHead_NotActiced.jpg';
                                        } else {
                                            alert(res.data.msg);
                                        }
                                    })
                                }
                            </script>
                        </form>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
<link rel="stylesheet" href="res/foot.css">
<div class="footdiv">
    <div class="footdiv1">
        <span style="cursor:pointer;">HNVS.CN</span> |
        <span style="cursor:pointer;">关于我们</span> |
        <span style="cursor:pointer;">意见反馈</span> |
        <span style="cursor:pointer;">使用帮助</span> |
        <span style="cursor:pointer;">联络我们</span> |
        <span style="cursor:pointer;">商务合作</span>
    </div>
    <div class="footdiv2">@ 2012-2022 hnvs.cn, All Rights Reserved.&nbsp;&nbsp;&nbsp;&nbsp;湘ICP备13009455号-1</div>
</div>
</body>
</html>